/*
 * HelloMidlet.java
 *
 * Created on August 18, 2007, 11:16 AM
 */

package flashomatic;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.util.*;

/**
 *
 * @author Administrator
 */
public class Flashomatic extends MIDlet implements CommandListener {
  
  /** Creates a new instance of HelloMidlet */
  public Flashomatic() {
  }
  
  private List mainMenu;//GEN-BEGIN:MVDFields
  private org.netbeans.microedition.lcdui.SplashScreen splashScreen;
  private Command okCommand1;
  private flashomatic.FlashomaticCanvas flashomaticCanvas;
  private Alert alert1;
  private Command okCommand2;
  private Command cancelCommand1;
  private List lesson;
  private List lessonBeg;
  private List lessonPim2;
  private List lessonPim1;
  private List lessonPim3;
  private List lessonFrequency;
  private List lessonCol;
  private List lessonInter;
  private Form form1;
  private Command okCommand3;
  private Command okCommand4;
  private StringItem stringItem1;
  private Spacer spacer1;
  private StringItem stringItem2;
  private Spacer spacer2;
  private StringItem stringItem3;//GEN-END:MVDFields
  
//GEN-LINE:MVDMethods

  /** This method initializes UI of the application.//GEN-BEGIN:MVDInitBegin
   */
  private void initialize() {//GEN-END:MVDInitBegin
    // Insert pre-init code here
    getDisplay().setCurrent(get_splashScreen());//GEN-LINE:MVDInitInit
    // Insert post-init code here
    

            
  }//GEN-LINE:MVDInitEnd
  
  /** Called by the system to indicate that a command has been invoked on a particular displayable.//GEN-BEGIN:MVDCABegin
   * @param command the Command that ws invoked
   * @param displayable the Displayable on which the command was invoked
   */
  public void commandAction(Command command, Displayable displayable) {//GEN-END:MVDCABegin
    // Insert global pre-action code here
    if (displayable == splashScreen) {//GEN-BEGIN:MVDCABody
      if (command == splashScreen.DISMISS_COMMAND) {//GEN-END:MVDCABody
        // Insert pre-action code here
        getDisplay().setCurrent(get_mainMenu());//GEN-LINE:MVDCAAction10
        // Insert post-action code here
      }//GEN-BEGIN:MVDCACase10
    } else if (displayable == mainMenu) {
      if (command == mainMenu.SELECT_COMMAND) {
        switch (get_mainMenu().getSelectedIndex()) {
          case 0://GEN-END:MVDCACase10
            // Insert pre-action code here
            flashomatic.FlashomaticCanvas fc = get_flashomaticCanvas();
            fc.start();
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction62
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase62
          case 2://GEN-END:MVDCACase62
            // Insert pre-action code here
            getDisplay().setCurrent(get_lesson());//GEN-LINE:MVDCAAction35
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase35
          case 3://GEN-END:MVDCACase35
            // Insert pre-action code here
            getDisplay().setCurrent(get_alert1(), get_mainMenu());//GEN-LINE:MVDCAAction37
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase37
          case 4://GEN-END:MVDCACase37
            // Insert pre-action code here
            exitMIDlet();//GEN-LINE:MVDCAAction33
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase33
          case 1://GEN-END:MVDCACase33
            // Insert pre-action code here
            getDisplay().setCurrent(get_form1());//GEN-LINE:MVDCAAction256
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase256
        }
      }
    } else if (displayable == alert1) {
      if (command == okCommand2) {//GEN-END:MVDCACase256
        // Insert pre-action code here
        getDisplay().setCurrent(get_mainMenu());//GEN-LINE:MVDCAAction41
        // Insert post-action code here
        get_flashomaticCanvas().knowledge = new Vector();
        
      } else if (command == cancelCommand1) {//GEN-LINE:MVDCACase41
        // Insert pre-action code here
        getDisplay().setCurrent(get_mainMenu());//GEN-LINE:MVDCAAction43
        // Insert post-action code here
      }//GEN-BEGIN:MVDCACase43
    } else if (displayable == lesson) {
      if (command == lesson.SELECT_COMMAND) {
        switch (get_lesson().getSelectedIndex()) {
          case 0://GEN-END:MVDCACase43
            // Insert pre-action code here
            getDisplay().setCurrent(get_lessonBeg());//GEN-LINE:MVDCAAction122
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase122
          case 3://GEN-END:MVDCACase122
            // Insert pre-action code here
            getDisplay().setCurrent(get_lessonPim1());//GEN-LINE:MVDCAAction124
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase124
          case 4://GEN-END:MVDCACase124
            // Insert pre-action code here
            getDisplay().setCurrent(get_lessonPim2());//GEN-LINE:MVDCAAction126
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase126
          case 5://GEN-END:MVDCACase126
            // Insert pre-action code here
            getDisplay().setCurrent(get_lessonPim3());//GEN-LINE:MVDCAAction128
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase128
          case 6://GEN-END:MVDCACase128
            // Insert pre-action code here
            getDisplay().setCurrent(get_lessonFrequency());//GEN-LINE:MVDCAAction130
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase130
          case 1://GEN-END:MVDCACase130
            // Insert pre-action code here
            getDisplay().setCurrent(get_lessonInter());//GEN-LINE:MVDCAAction206
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase206
          case 2://GEN-END:MVDCACase206
            // Insert pre-action code here
            getDisplay().setCurrent(get_lessonCol());//GEN-LINE:MVDCAAction208
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase208
        }
      }
    } else if (displayable == lessonFrequency) {
      if (command == lessonFrequency.SELECT_COMMAND) {
        switch (get_lessonFrequency().getSelectedIndex()) {
          case 0://GEN-END:MVDCACase208
            get_flashomaticCanvas().setStack("/stacks/frequency_list_1-100.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction192
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase192
          case 1://GEN-END:MVDCACase192
            get_flashomaticCanvas().setStack("/stacks/frequency_list_101-200.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction194
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase194
          case 2://GEN-END:MVDCACase194
            get_flashomaticCanvas().setStack("/stacks/frequency_list_201-300.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction196
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase196
          case 3://GEN-END:MVDCACase196
            get_flashomaticCanvas().setStack("/stacks/frequency_list_301-400.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction198
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase198
          case 4://GEN-END:MVDCACase198
            get_flashomaticCanvas().setStack("/stacks/frequency_list_401-500.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction200
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase200
          case 5://GEN-END:MVDCACase200
            get_flashomaticCanvas().setStack("/stacks/frequency_list_501-600.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction202
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase202
          case 6://GEN-END:MVDCACase202
            get_flashomaticCanvas().setStack("/stacks/frequency_list_601-700.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction204
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase204
        }
      }
    } else if (displayable == lessonPim1) {
      if (command == lessonPim1.SELECT_COMMAND) {
        switch (get_lessonPim1().getSelectedIndex()) {
          case 0://GEN-END:MVDCACase204
            get_flashomaticCanvas().setStack("/stacks/pimsleur1_1-5.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction172
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase172
          case 1://GEN-END:MVDCACase172
            get_flashomaticCanvas().setStack("/stacks/pimsleur1_6-10.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction174
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase174
          case 2://GEN-END:MVDCACase174
            get_flashomaticCanvas().setStack("/stacks/pimsleur1_11-15.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction176
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase176
          case 3://GEN-END:MVDCACase176
            get_flashomaticCanvas().setStack("/stacks/pimsleur1_16-20.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction178
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase178
          case 4://GEN-END:MVDCACase178
            get_flashomaticCanvas().setStack("/stacks/pimsleur1_21-25.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction180
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase180
        }
      }
    } else if (displayable == lessonBeg) {
      if (command == lessonBeg.SELECT_COMMAND) {
        switch (get_lessonBeg().getSelectedIndex()) {
          case 0://GEN-END:MVDCACase180
            get_flashomaticCanvas().setStack("/stacks/beg_chinese_lesson1.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction142
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase142
          case 1://GEN-END:MVDCACase142
            get_flashomaticCanvas().setStack("/stacks/beg_chinese_lesson2.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction144
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase144
          case 2://GEN-END:MVDCACase144
            get_flashomaticCanvas().setStack("/stacks/beg_chinese_lesson3.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction146
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase146
          case 3://GEN-END:MVDCACase146
            get_flashomaticCanvas().setStack("/stacks/beg_chinese_lesson4.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction148
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase148
          case 4://GEN-END:MVDCACase148
            get_flashomaticCanvas().setStack("/stacks/beg_chinese_lesson5.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction150
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase150
          case 5://GEN-END:MVDCACase150
            get_flashomaticCanvas().setStack("/stacks/beg_chinese_lesson6.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction152
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase152
          case 6://GEN-END:MVDCACase152
            get_flashomaticCanvas().setStack("/stacks/beg_chinese_lesson7.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction154
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase154
          case 7://GEN-END:MVDCACase154
            get_flashomaticCanvas().setStack("/stacks/beg_chinese_lesson8.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction156
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase156
          case 8://GEN-END:MVDCACase156
            get_flashomaticCanvas().setStack("/stacks/beg_chinese_lesson9.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction158
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase158
          case 9://GEN-END:MVDCACase158
            get_flashomaticCanvas().setStack("/stacks/beg_chinese_lesson10.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction160
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase160
        }
      }
    } else if (displayable == lessonPim3) {
      if (command == lessonPim3.SELECT_COMMAND) {
        switch (get_lessonPim3().getSelectedIndex()) {
          case 0://GEN-END:MVDCACase160
            get_flashomaticCanvas().setStack("/stacks/pimsleur3_1-5.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction182
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase182
          case 1://GEN-END:MVDCACase182
            get_flashomaticCanvas().setStack("/stacks/pimsleur3_6-10.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction184
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase184
          case 2://GEN-END:MVDCACase184
            get_flashomaticCanvas().setStack("/stacks/pimsleur3_11-15.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction186
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase186
          case 3://GEN-END:MVDCACase186
            get_flashomaticCanvas().setStack("/stacks/pimsleur3_16-20.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction188
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase188
          case 4://GEN-END:MVDCACase188
            get_flashomaticCanvas().setStack("/stacks/pimsleur3_21-25.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction190
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase190
        }
      }
    } else if (displayable == lessonPim2) {
      if (command == lessonPim2.SELECT_COMMAND) {
        switch (get_lessonPim2().getSelectedIndex()) {
          case 0://GEN-END:MVDCACase190
            get_flashomaticCanvas().setStack("/stacks/pimsleur2_1-5.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction162
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase162
          case 1://GEN-END:MVDCACase162
            get_flashomaticCanvas().setStack("/stacks/pimsleur2_6-10.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction166
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase166
          case 2://GEN-END:MVDCACase166
            get_flashomaticCanvas().setStack("/stacks/pimsleur2_11-15.txt");
            // Do nothing//GEN-LINE:MVDCAAction170
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase170
          case 3://GEN-END:MVDCACase170
            get_flashomaticCanvas().setStack("/stacks/pimsleur2_16-20.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction164
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase164
          case 4://GEN-END:MVDCACase164
            get_flashomaticCanvas().setStack("/stacks/pimsleur2_21-25.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction168
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase168
        }
      }
    } else if (displayable == lessonInter) {
      if (command == lessonInter.SELECT_COMMAND) {
        switch (get_lessonInter().getSelectedIndex()) {
          case 0://GEN-END:MVDCACase168
            get_flashomaticCanvas().setStack("/stacks/intermediate_chinese_lesson2.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction236
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase236
          case 1://GEN-END:MVDCACase236
            get_flashomaticCanvas().setStack("/stacks/intermediate_chinese_lesson3.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction238
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase238
          case 2://GEN-END:MVDCACase238
            get_flashomaticCanvas().setStack("/stacks/intermediate_chinese_lesson4.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction240
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase240
          case 3://GEN-END:MVDCACase240
            get_flashomaticCanvas().setStack("/stacks/intermediate_chinese_lesson5.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction242
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase242
          case 4://GEN-END:MVDCACase242
            get_flashomaticCanvas().setStack("/stacks/intermediate_chinese_lesson6.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction244
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase244
          case 5://GEN-END:MVDCACase244
            get_flashomaticCanvas().setStack("/stacks/intermediate_chinese_lesson7.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction246
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase246
          case 6://GEN-END:MVDCACase246
            get_flashomaticCanvas().setStack("/stacks/intermediate_chinese_lesson7_supp.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction248
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase248
          case 7://GEN-END:MVDCACase248
            get_flashomaticCanvas().setStack("/stacks/intermediate_chinese_lesson8.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction250
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase250
          case 8://GEN-END:MVDCACase250
            get_flashomaticCanvas().setStack("/stacks/intermediate_chinese_lesson8_supp.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction252
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase252
        }
      }
    } else if (displayable == lessonCol) {
      if (command == lessonCol.SELECT_COMMAND) {
        switch (get_lessonCol().getSelectedIndex()) {
          case 0://GEN-END:MVDCACase252
            get_flashomaticCanvas().setStack("/stacks/colloqial_chinese_Lesson1.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction214
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase214
          case 1://GEN-END:MVDCACase214
            get_flashomaticCanvas().setStack("/stacks/colloqial_chinese_Lesson2.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction216
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase216
          case 2://GEN-END:MVDCACase216
            get_flashomaticCanvas().setStack("/stacks/colloqial_chinese_Lesson3.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction218
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase218
          case 3://GEN-END:MVDCACase218
            get_flashomaticCanvas().setStack("/stacks/colloqial_chinese_Lesson4.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction220
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase220
          case 4://GEN-END:MVDCACase220
            get_flashomaticCanvas().setStack("/stacks/colloqial_chinese_Lesson5.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction222
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase222
          case 5://GEN-END:MVDCACase222
            get_flashomaticCanvas().setStack("/stacks/colloqial_chinese_Lesson6.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction224
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase224
          case 6://GEN-END:MVDCACase224
            get_flashomaticCanvas().setStack("/stacks/colloqial_chinese_Lesson7.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction226
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase226
          case 7://GEN-END:MVDCACase226
            get_flashomaticCanvas().setStack("/stacks/colloqial_chinese_Lesson8.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction228
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase228
          case 8://GEN-END:MVDCACase228
            get_flashomaticCanvas().setStack("/stacks/colloqial_chinese_Lesson9.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction232
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase232
          case 9://GEN-END:MVDCACase232
            get_flashomaticCanvas().setStack("/stacks/colloqial_chinese_Lesson10.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction230
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase230
          case 10://GEN-END:MVDCACase230
            get_flashomaticCanvas().setStack("/stacks/colloqial_chinese_Lesson11.txt");
            getDisplay().setCurrent(get_flashomaticCanvas());//GEN-LINE:MVDCAAction234
            // Insert post-action code here
            break;//GEN-BEGIN:MVDCACase234
        }
      }
    } else if (displayable == form1) {
      if (command == okCommand4) {//GEN-END:MVDCACase234
        // Insert pre-action code here
        getDisplay().setCurrent(get_mainMenu());//GEN-LINE:MVDCAAction260
        // Insert post-action code here
      }//GEN-BEGIN:MVDCACase260
    }//GEN-END:MVDCACase260
    // Insert global post-action code here
}//GEN-LINE:MVDCAEnd
  
  /**
   * This method should return an instance of the display.
   */
  public Display getDisplay() {//GEN-FIRST:MVDGetDisplay
    return Display.getDisplay(this);
  }//GEN-LAST:MVDGetDisplay
  
  /**
   * This method should exit the midlet.
   */
  public void exitMIDlet() {//GEN-FIRST:MVDExitMidlet
    
    RecordManager rm = new RecordManager();
    rm.SaveKnowlege(get_flashomaticCanvas().knowledge);
    rm.SaveLesson(get_flashomaticCanvas().stackName);
    //rm.SavePrefs(null);
    
    getDisplay().setCurrent(null);
    destroyApp(true);
    notifyDestroyed();
  }//GEN-LAST:MVDExitMidlet
  
  
  

  /** This method returns instance for mainMenu component and should be called instead of accessing mainMenu field directly.//GEN-BEGIN:MVDGetBegin7
   * @return Instance for mainMenu component
   */
  public List get_mainMenu() {
    if (mainMenu == null) {//GEN-END:MVDGetBegin7
      // Insert pre-init code here
      mainMenu = new List("Main Menu", Choice.IMPLICIT, new String[] {//GEN-BEGIN:MVDGetInit7
        "Start flashing me!",
        "How to use",
        "Set flash card stack",
        "Reset all words",
        "Exit"
      }, new Image[] {
        null,
        null,
        null,
        null,
        null
      });
      mainMenu.setCommandListener(this);
      mainMenu.setSelectedFlags(new boolean[] {
        false,
        false,
        false,
        false,
        false
      });//GEN-END:MVDGetInit7
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd7
    return mainMenu;
  }//GEN-END:MVDGetEnd7

  /** This method returns instance for splashScreen component and should be called instead of accessing splashScreen field directly.//GEN-BEGIN:MVDGetBegin9
   * @return Instance for splashScreen component
   */
  public org.netbeans.microedition.lcdui.SplashScreen get_splashScreen() {
    if (splashScreen == null) {//GEN-END:MVDGetBegin9
      // Insert pre-init code here
      splashScreen = new org.netbeans.microedition.lcdui.SplashScreen(getDisplay());//GEN-BEGIN:MVDGetInit9
      splashScreen.setCommandListener(this);
      splashScreen.setFullScreenMode(true);
      splashScreen.setText("www.meharg.com");
      splashScreen.setTimeout(2000);//GEN-END:MVDGetInit9
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd9
    return splashScreen;
  }//GEN-END:MVDGetEnd9
 
  /** This method returns instance for okCommand1 component and should be called instead of accessing okCommand1 field directly.//GEN-BEGIN:MVDGetBegin13
   * @return Instance for okCommand1 component
   */
  public Command get_okCommand1() {
    if (okCommand1 == null) {//GEN-END:MVDGetBegin13
      // Insert pre-init code here
      okCommand1 = new Command("Ok", Command.OK, 1);//GEN-LINE:MVDGetInit13
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd13
    return okCommand1;
  }//GEN-END:MVDGetEnd13

  /** This method returns instance for flashomaticCanvas component and should be called instead of accessing flashomaticCanvas field directly.//GEN-BEGIN:MVDGetBegin23
   * @return Instance for flashomaticCanvas component
   */
  public flashomatic.FlashomaticCanvas get_flashomaticCanvas() {
    if (flashomaticCanvas == null) {//GEN-END:MVDGetBegin23

      flashomaticCanvas = new flashomatic.FlashomaticCanvas();//GEN-LINE:MVDGetInit23
      flashomaticCanvas.setMidlet (this);
      
      RecordManager rm = new RecordManager();
      rm.LoadKnowledge(flashomaticCanvas.knowledge);
      flashomaticCanvas.stackName = rm.LoadLesson();
      flashomaticCanvas.setStack(null);
  
    }//GEN-BEGIN:MVDGetEnd23
    return flashomaticCanvas;
  }//GEN-END:MVDGetEnd23

  /** This method returns instance for alert1 component and should be called instead of accessing alert1 field directly.//GEN-BEGIN:MVDGetBegin38
   * @return Instance for alert1 component
   */
  public Alert get_alert1() {
    if (alert1 == null) {//GEN-END:MVDGetBegin38
      // Insert pre-init code here
      alert1 = new Alert("Reset current stack", "Are you sure you want to forget your progress on all words?", null, AlertType.CONFIRMATION);//GEN-BEGIN:MVDGetInit38
      alert1.addCommand(get_okCommand2());
      alert1.addCommand(get_cancelCommand1());
      alert1.setCommandListener(this);
      alert1.setTimeout(-2);//GEN-END:MVDGetInit38
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd38
    return alert1;
  }//GEN-END:MVDGetEnd38

  /** This method returns instance for okCommand2 component and should be called instead of accessing okCommand2 field directly.//GEN-BEGIN:MVDGetBegin40
   * @return Instance for okCommand2 component
   */
  public Command get_okCommand2() {
    if (okCommand2 == null) {//GEN-END:MVDGetBegin40
      // Insert pre-init code here
      okCommand2 = new Command("Ok", Command.OK, 1);//GEN-LINE:MVDGetInit40
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd40
    return okCommand2;
  }//GEN-END:MVDGetEnd40

  /** This method returns instance for cancelCommand1 component and should be called instead of accessing cancelCommand1 field directly.//GEN-BEGIN:MVDGetBegin42
   * @return Instance for cancelCommand1 component
   */
  public Command get_cancelCommand1() {
    if (cancelCommand1 == null) {//GEN-END:MVDGetBegin42
      // Insert pre-init code here
      cancelCommand1 = new Command("Cancel", Command.CANCEL, 1);//GEN-LINE:MVDGetInit42
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd42
    return cancelCommand1;
  }//GEN-END:MVDGetEnd42
 
  /** This method returns instance for lesson component and should be called instead of accessing lesson field directly.//GEN-BEGIN:MVDGetBegin119
   * @return Instance for lesson component
   */
  public List get_lesson() {
    if (lesson == null) {//GEN-END:MVDGetBegin119
      // Insert pre-init code here
      lesson = new List("Lesson", Choice.IMPLICIT, new String[] {//GEN-BEGIN:MVDGetInit119
        "Beginners",
        "Intermediate",
        "Colloquial",
        "Pimsleur 1",
        "Pimsleur 2",
        "Pimsleur 3",
        "Frequency"
      }, new Image[] {
        null,
        null,
        null,
        null,
        null,
        null,
        null
      });
      lesson.setCommandListener(this);
      lesson.setSelectedFlags(new boolean[] {
        false,
        false,
        false,
        false,
        false,
        false,
        false
      });//GEN-END:MVDGetInit119
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd119
    return lesson;
  }//GEN-END:MVDGetEnd119

  /** This method returns instance for lessonBeg component and should be called instead of accessing lessonBeg field directly.//GEN-BEGIN:MVDGetBegin131
   * @return Instance for lessonBeg component
   */
  public List get_lessonBeg() {
    if (lessonBeg == null) {//GEN-END:MVDGetBegin131
      // Insert pre-init code here
      lessonBeg = new List("Beginners", Choice.IMPLICIT, new String[] {//GEN-BEGIN:MVDGetInit131
        "Beginners 1",
        "Beginners 2",
        "Beginners 3",
        "Beginners 4",
        "Beginners 5",
        "Beginners 6",
        "Beginners 7",
        "Beginners 8",
        "Beginners 9",
        "Beginners 10"
      }, new Image[] {
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null
      });
      lessonBeg.setCommandListener(this);
      lessonBeg.setSelectedFlags(new boolean[] {
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false
      });//GEN-END:MVDGetInit131
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd131
    return lessonBeg;
  }//GEN-END:MVDGetEnd131

  /** This method returns instance for lessonPim2 component and should be called instead of accessing lessonPim2 field directly.//GEN-BEGIN:MVDGetBegin133
   * @return Instance for lessonPim2 component
   */
  public List get_lessonPim2() {
    if (lessonPim2 == null) {//GEN-END:MVDGetBegin133
      // Insert pre-init code here
      lessonPim2 = new List("Pimsleur 2", Choice.IMPLICIT, new String[] {//GEN-BEGIN:MVDGetInit133
        "Pimsleur 1-5",
        "Pimsleur 6-10",
        "Pimsleur 11-16",
        "Pimsleur 17-20",
        "Pimsleur 21-25"
      }, new Image[] {
        null,
        null,
        null,
        null,
        null
      });
      lessonPim2.setCommandListener(this);
      lessonPim2.setSelectedFlags(new boolean[] {
        false,
        false,
        false,
        false,
        false
      });//GEN-END:MVDGetInit133
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd133
    return lessonPim2;
  }//GEN-END:MVDGetEnd133

  /** This method returns instance for lessonPim1 component and should be called instead of accessing lessonPim1 field directly.//GEN-BEGIN:MVDGetBegin135
   * @return Instance for lessonPim1 component
   */
  public List get_lessonPim1() {
    if (lessonPim1 == null) {//GEN-END:MVDGetBegin135
      // Insert pre-init code here
      lessonPim1 = new List("Pimsleur 1", Choice.IMPLICIT, new String[] {//GEN-BEGIN:MVDGetInit135
        "Pimsleur 1-5",
        "Pimsleur 6-10",
        "Pimsleur 11-16",
        "Pimsleur 17-20",
        "Pimsleur 21-25"
      }, new Image[] {
        null,
        null,
        null,
        null,
        null
      });
      lessonPim1.setCommandListener(this);
      lessonPim1.setSelectedFlags(new boolean[] {
        false,
        false,
        false,
        false,
        false
      });//GEN-END:MVDGetInit135
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd135
    return lessonPim1;
  }//GEN-END:MVDGetEnd135

  /** This method returns instance for lessonPim3 component and should be called instead of accessing lessonPim3 field directly.//GEN-BEGIN:MVDGetBegin137
   * @return Instance for lessonPim3 component
   */
  public List get_lessonPim3() {
    if (lessonPim3 == null) {//GEN-END:MVDGetBegin137
      // Insert pre-init code here
      lessonPim3 = new List("Pimsleur 3", Choice.IMPLICIT, new String[] {//GEN-BEGIN:MVDGetInit137
        "Pimsleur 1-5",
        "Pimsleur 6-10",
        "Pimsleur 11-20",
        "Pimsleur 16-20",
        "Pimsleur 21-25"
      }, new Image[] {
        null,
        null,
        null,
        null,
        null
      });
      lessonPim3.setCommandListener(this);
      lessonPim3.setSelectedFlags(new boolean[] {
        false,
        false,
        false,
        false,
        false
      });//GEN-END:MVDGetInit137
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd137
    return lessonPim3;
  }//GEN-END:MVDGetEnd137

  /** This method returns instance for lessonFrequency component and should be called instead of accessing lessonFrequency field directly.//GEN-BEGIN:MVDGetBegin139
   * @return Instance for lessonFrequency component
   */
  public List get_lessonFrequency() {
    if (lessonFrequency == null) {//GEN-END:MVDGetBegin139
      // Insert pre-init code here
      lessonFrequency = new List("Most Frequent Characters", Choice.IMPLICIT, new String[] {//GEN-BEGIN:MVDGetInit139
        "1-100",
        "101-200",
        "201-300",
        "301-400",
        "401-500",
        "501-600",
        "601-700"
      }, new Image[] {
        null,
        null,
        null,
        null,
        null,
        null,
        null
      });
      lessonFrequency.setCommandListener(this);
      lessonFrequency.setSelectedFlags(new boolean[] {
        false,
        false,
        false,
        false,
        false,
        false,
        false
      });//GEN-END:MVDGetInit139
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd139
    return lessonFrequency;
  }//GEN-END:MVDGetEnd139

  /** This method returns instance for lessonCol component and should be called instead of accessing lessonCol field directly.//GEN-BEGIN:MVDGetBegin209
   * @return Instance for lessonCol component
   */
  public List get_lessonCol() {
    if (lessonCol == null) {//GEN-END:MVDGetBegin209
      // Insert pre-init code here
      lessonCol = new List("Colloquial Chinese", Choice.IMPLICIT, new String[] {//GEN-BEGIN:MVDGetInit209
        "Chapter 1",
        "Chapter 2",
        "Chapter 3",
        "Chapter 4",
        "Chapter 5",
        "Chapter 6",
        "Chapter 7",
        "Chapter 8",
        "Chapter 9",
        "Chapter 10",
        "Chapter 11"
      }, new Image[] {
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null
      });
      lessonCol.setCommandListener(this);
      lessonCol.setSelectedFlags(new boolean[] {
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false
      });//GEN-END:MVDGetInit209
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd209
    return lessonCol;
  }//GEN-END:MVDGetEnd209

  /** This method returns instance for lessonInter component and should be called instead of accessing lessonInter field directly.//GEN-BEGIN:MVDGetBegin211
   * @return Instance for lessonInter component
   */
  public List get_lessonInter() {
    if (lessonInter == null) {//GEN-END:MVDGetBegin211
      // Insert pre-init code here
      lessonInter = new List("Intermediate Chinese", Choice.IMPLICIT, new String[] {//GEN-BEGIN:MVDGetInit211
        "Lesson 2",
        "Lesson 3",
        "Lesson 4",
        "Lesson 5",
        "Lesson 6",
        "Lesson 7",
        "Lesson 7 Sup",
        "Lesson 8",
        "Lesson 8 Sup"
      }, new Image[] {
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null
      });
      lessonInter.setCommandListener(this);
      lessonInter.setSelectedFlags(new boolean[] {
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false
      });//GEN-END:MVDGetInit211
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd211
    return lessonInter;
  }//GEN-END:MVDGetEnd211

  /** This method returns instance for form1 component and should be called instead of accessing form1 field directly.//GEN-BEGIN:MVDGetBegin257
   * @return Instance for form1 component
   */
  public Form get_form1() {
    if (form1 == null) {//GEN-END:MVDGetBegin257
      // Insert pre-init code here
      form1 = new Form("Help", new Item[] {//GEN-BEGIN:MVDGetInit257
        get_stringItem1(),
        get_spacer1(),
        get_stringItem3(),
        get_spacer2(),
        get_stringItem2()
      });
      form1.addCommand(get_okCommand4());
      form1.setCommandListener(this);//GEN-END:MVDGetInit257
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd257
    return form1;
  }//GEN-END:MVDGetEnd257

  /** This method returns instance for okCommand3 component and should be called instead of accessing okCommand3 field directly.//GEN-BEGIN:MVDGetBegin258
   * @return Instance for okCommand3 component
   */
  public Command get_okCommand3() {
    if (okCommand3 == null) {//GEN-END:MVDGetBegin258
      // Insert pre-init code here
      okCommand3 = new Command("Ok", Command.OK, 1);//GEN-LINE:MVDGetInit258
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd258
    return okCommand3;
  }//GEN-END:MVDGetEnd258

  /** This method returns instance for okCommand4 component and should be called instead of accessing okCommand4 field directly.//GEN-BEGIN:MVDGetBegin259
   * @return Instance for okCommand4 component
   */
  public Command get_okCommand4() {
    if (okCommand4 == null) {//GEN-END:MVDGetBegin259
      // Insert pre-init code here
      okCommand4 = new Command("Ok", Command.OK, 1);//GEN-LINE:MVDGetInit259
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd259
    return okCommand4;
  }//GEN-END:MVDGetEnd259

  /** This method returns instance for stringItem1 component and should be called instead of accessing stringItem1 field directly.//GEN-BEGIN:MVDGetBegin261
   * @return Instance for stringItem1 component
   */
  public StringItem get_stringItem1() {
    if (stringItem1 == null) {//GEN-END:MVDGetBegin261
      // Insert pre-init code here
      stringItem1 = new StringItem("How to use this application\n", "\nSelect your lesson and the words list.  The words are from \nhttp://zdt.sourceforge.net \nAny words that you mark as known will be saved for the next time you use the application.\n");//GEN-LINE:MVDGetInit261
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd261
    return stringItem1;
  }//GEN-END:MVDGetEnd261

  /** This method returns instance for spacer1 component and should be called instead of accessing spacer1 field directly.//GEN-BEGIN:MVDGetBegin262
   * @return Instance for spacer1 component
   */
  public Spacer get_spacer1() {
    if (spacer1 == null) {//GEN-END:MVDGetBegin262
      // Insert pre-init code here
      spacer1 = new Spacer(1000, 1);//GEN-LINE:MVDGetInit262
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd262
    return spacer1;
  }//GEN-END:MVDGetEnd262

  /** This method returns instance for stringItem2 component and should be called instead of accessing stringItem2 field directly.//GEN-BEGIN:MVDGetBegin263
   * @return Instance for stringItem2 component
   */
  public StringItem get_stringItem2() {
    if (stringItem2 == null) {//GEN-END:MVDGetBegin263
      // Insert pre-init code here
      stringItem2 = new StringItem("Flashomatic (c)2007 Gersham Meharg", "\nvist http://www.meharg.com for more information.  This software is free to use and to redistribute. \n\n");//GEN-LINE:MVDGetInit263
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd263
    return stringItem2;
  }//GEN-END:MVDGetEnd263

  /** This method returns instance for spacer2 component and should be called instead of accessing spacer2 field directly.//GEN-BEGIN:MVDGetBegin264
   * @return Instance for spacer2 component
   */
  public Spacer get_spacer2() {
    if (spacer2 == null) {//GEN-END:MVDGetBegin264
      // Insert pre-init code here
      spacer2 = new Spacer(1000, 1);//GEN-LINE:MVDGetInit264
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd264
    return spacer2;
  }//GEN-END:MVDGetEnd264

  /** This method returns instance for stringItem3 component and should be called instead of accessing stringItem3 field directly.//GEN-BEGIN:MVDGetBegin265
   * @return Instance for stringItem3 component
   */
  public StringItem get_stringItem3() {
    if (stringItem3 == null) {//GEN-END:MVDGetBegin265
      // Insert pre-init code here
      stringItem3 = new StringItem("Key Shortcuts\n", "\nWhen viewing a word you can press Up if you know the word.  Press Down to mark a known word as unknown.   Press right and left to scroll through the words.   Press Select to show first the character, then the Pinyin, then english translation of a word, then move to the next word.");//GEN-LINE:MVDGetInit265
      // Insert post-init code here
    }//GEN-BEGIN:MVDGetEnd265
    return stringItem3;
  }//GEN-END:MVDGetEnd265
  
  public void startApp() {
    initialize();
  }
  
  public void pauseApp() {
  }
  
  public void destroyApp(boolean unconditional) {
  }
  
}
